import time
import unittest
# 创建测试套件
import HTMLTestRunner_PY3

from app import BASE_DIR
from scripts.test_emp_params import TestEmployeeParam
from scripts.test_login_params import TestLoginParams

suite = unittest.TestSuite()
# 添加测试用例
suite.addTest(unittest.makeSuite(TestLoginParams))
suite.addTest(unittest.makeSuite(TestEmployeeParam))
# 定义测试报告名称
# ihrm_path = BASE_DIR + "/report/ihrm{}.html".format(time.strftime("%Y%m%d %H%S%M"))
ihrm_path = BASE_DIR + "/report/ihrm.html"
with open(ihrm_path,mode ="wb" )as f:
    runner = HTMLTestRunner_PY3.HTMLTestRunner(f,verbosity=2,title="ihrm测试报告",description="生成测试报告")
    # 运行测试套件
    runner.run(suite)
